import request from '@/plugins/request'
import { IResponseData } from '@/types/request-base'
import { json2FormData } from '@/utils'

// 经销商分店关店

/**
 * 经销商分店关店详情
 * @param {string} ID
 */
export function detail(id: string) {
  return request<IResponseData>({
    method: 'get',
    url: `/app/v1/ctmCustomerChange/detail/shopClose/${id}`,
    loading: true
  })
}

/**
 * 经销商分店关店保存
 */
export function saveChange(data: any) {
  return request<IResponseData>({
    method: 'PUT',
    url: `/app/v1/ctmCustomerChange`,
    data,
    loading: true
  })
}

/**
 * 经销商分店关店-提交
 * @param {Array} data
 */
export function submitChange(data: any) {
  return request<IResponseData>({
    method: 'post',
    url: `/app/v1/ctmCustomerChange/shopClose/submit`,
    data,
    loading: true
  })
}

/**
 * 经销商分店关店保存/提交
 */
export function saveOrSubmit(data: any) {
  return request<IResponseData>({
    method: 'post',
    url: `/app/v1/ctmCustomerChange/createOrSubmit/shopClose`,
    data,
    loading: true
  })
}
